﻿<?php
// no direct access
defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.application.component.view');

require_once JPATH_COMPONENT.DS.'/helpers/functions.check.php';
require_once JPATH_COMPONENT.DS.'/helpers/functions.moderator.php';


class EventcalendarViewMonth extends JView {
	function display($tpl = null) {
		
		if (isAdmin())
		{
			//Moderaattorin model
			$moderator_model = &$this->getModel('moderator');
			moderatorData(&$moderator_model, &$this);
		}

		//Saako moderoida parametriksi
		$this->assignRef('moderate', isAdmin());
	
	
		//From, jotta tiedetään mihin palata
		$month 	= 	JRequest::getVar( 'month', date("m") );
		$year 	= 	JRequest::getVar( 'year', date("Y") );
		// fullcalendar/js haluaa kuukaudet lukuina 0-11
		$this->assignRef('month', --$month);
		$this->assignRef('year', $year);
	
	
		$events	=& $this->get('events');	
		$this->assignRef('events', $events);
		parent::display($tpl);
	}	
}
